import React,{ Component } from 'react';

import { Popover, Button } from 'antd';

class Popovers extends React.Component {
  state = {
    visible: false,
  }
  hide = () => {
    this.setState({
      visible: false,
    });
  }
  handleVisibleChange = (visible) => {
    this.setState({ 
    	visible: !this.state.visible
    });
  }
  render() {
    return (
      <Popover
        content={<a onClick={this.hide}>Close</a>}
        title="Title"
        trigger="click"
        visible={this.state.visible}
        
        onClick={ this.handleVisibleChange }
      >
        <Button type="primary">Click me</Button>
      </Popover>
    );
  }
}

export default Popovers;